home *** CD-ROM | disk | FTP | other *** search
- Path: symiserver2.symantec.com!usenet
- From: Walter Bright <wbright@symantec.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Inline Assembler and OOP
- Date: Sat, 16 Mar 1996 15:11:12 -0800
- Organization: Symantec Development Tools Business Unit
- Message-ID: <314B4A90.64BE@symantec.com>
- References: <4iaqcn$mfu@masala.cc.uh.edu>
- NNTP-Posting-Host: 155.64.77.131
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (WinNT; I)
-
- Sensarn wrote:
- < struct double_buffer {
- < unsigned char *buffer; /* Actual data */
- < unsigned int buffer_size; /* Actual size of buffer */
- < double_buffer(int num_lines=200); /* Constructor */
- < };
- < double_buffer::double_buffer(int num_lines) {
- < asm {
- < les di,buffer /* Expression syntax error here */
- < mov cx,buffer_size/2 /* Here too */
- < }
- < }
- < Is there some reason why I cannot access buffer and buffer_size in the
- < asm statement (even though the asm statement is inside a member
- < function).
-
- The trouble is that 'buffer' can only be accessed through the 'this' pointer.
- Your asm code needs to be rewritten as:
- les di,this
- mov cx,es:buffer_size[di]
- shr cx,1
- les di,es:buffer[di]
-